import request from '@/utils/axios'

export interface TenantPackageType {
  id: number
  name: string
  type: number
  accountCount: number
  menuIds: number[]
  status: number
  remark: string
  create_time?: Date
}

export interface TenantPackagePageReqType extends PageParam {
  name?: string
  type?: number
  status?: number
  create_time?: Date[]
}

/**
 * 租户套餐接口
 */
export const TenantPackageApi = {
  // 新增
  create: (data: TenantPackageType) => {
    return request.post({ url: '/system/tenant-package/create', data, is_mock: true })
  },
  // 修改
  update: (data: TenantPackageType) => {
    return request.put({ url: '/system/tenant-package/update', data, is_mock: true })
  },
  // 删除
  delete: (id: number) => {
    return request.delete({ url: '/system/tenant-package/delete?id=' + id, is_mock: true })
  },
  // 查询详情
  detail: (id: number) => {
    return request.get({ url: '/system/tenant-package/detail?id=' + id, is_mock: true })
  },
  // 查询分页列表
  page: (params: TenantPackagePageReqType) => {
    return request.get({ url: '/system/tenant-package/page', params, is_mock: true })
  },
  // 查询列表
  simple: () => {
    return request.get({ url: '/system/tenant-package/simple-list', is_mock: true })
  }
}
